<template>
  <div id="finishBank">
    <a-list
        :max-height="680"
        :gridProps="{ gutter: 0, span:8 }"
        :bordered="false"
    >
      <a-list-item v-for="bank in finishBanks"
                   :key="bank.questionBankId"
                   :style="{ width: '360px' , textAlign: 'center'}"
                   :title="bank.questionBankName"
                   @click="clickFinishBank(bank.id)">
        <a-card hoverable :title="bank.questionBankName">
          <div style="text-align: left">
            完成时间：{{ bank.updateTime }}
          </div>
          <div style="text-align: left">
            得分：{{ bank.score }}
          </div>
        </a-card>
      </a-list-item>
    </a-list>

  </div>
</template>
<script setup>
import {useRouter} from "vue-router";

let finishBanks = ref([]);

import {onMounted, ref} from "vue";
import {listMyAnswerResultVOByPageUsingPost} from "@/api/AnswerResultRequest";

const router = useRouter();

onMounted(async () => {
  const result = await listMyAnswerResultVOByPageUsingPost({
    current: 1,
    pageSize: 5
  });
  if (result.data.code === 0) {
    finishBanks.value = result.data.data.records;
  }
  console.log(finishBanks.value);
})

function clickFinishBank(answerId) {
  router.push("/answerResult/" + answerId);
}

</script>
<style scoped>

</style>